﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;

namespace DAL
{
    public abstract class ChucnangnhomDAL:BaseDAL,IBase
    {
        #region IBase Members

        public int Count()
        {
            throw new NotImplementedException();
        }

        public object Select(string code)
        {
            throw new NotImplementedException();
        }

        public System.Data.DataTable Select(Guid fKey)
        {
            throw new NotImplementedException();
        }

        public System.Data.DataTable Select(object obj, int skip, int take)
        {
            throw new NotImplementedException();
        }

        public object Insert(object obj)
        {
            throw new NotImplementedException();
        }

        public object Update(object obj)
        {
            throw new NotImplementedException();
        }

        public object Delete(Guid id)
        {
            throw new NotImplementedException();
        }

        #endregion

        public DataTable Chucnangnhom_Select_By_Id_Nhomnguoidung(Guid Id_Nhomnguoidung)
        {
            return Mapper.QueryForDataTable("Chucnangnhom_Select_By_Id_Nhomnguoidung", Id_Nhomnguoidung, "Temp");
        }

        public bool Chucnangnhom_Insert(DAL.Entities.Chucnangnhom cnn)
        {
            try
            {
                _sqlMapper.Insert("Chucnangnhom_Insert", cnn);
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }

        public bool Chucnangnhom_Delete_By_Id_Nhomnguoidung(Guid Id_Nhomnguoidung)
        {
            try
            {
                _sqlMapper.Delete("Chucnangnhom_Delete_By_Id_Nhomnguoidung", Id_Nhomnguoidung);
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
    }
}
